home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech's Sprocket™ / SprocketGX / AppSpecific / DocWindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-17  |  1.9 KB  |  87 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        DocWindow.h
  3.  
  4.     Contains:    A simple document window
  5.                 
  6.     Written by: Dave Falkenburg
  7.     
  8.     Copyright:    © 1993-94 by Dave Falkenburg, all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.      
  12.  */
  13.  
  14. #ifndef        _DOCWINDOW_
  15. #define        _DOCWINDOW_
  16.  
  17. #ifndef        _WINDOW_
  18.     #include    "Window.h"
  19. #endif
  20.  
  21. #ifndef        __THREADS__
  22.     #include    <Threads.h>
  23. #endif
  24.  
  25. #ifndef        _DOCFILE_
  26.     #include "DocFile.h"
  27. #endif
  28.  
  29. #ifndef        __PRINTING__
  30.     #include    <Printing.h>
  31. #endif
  32.  
  33. const short        kHeaderHeight = 20;
  34. const short        kScrollbarWidth = 15;
  35.  
  36. const short        kFirstSpinningArrowIconID = 801;
  37. const short        kLastSpinningArrowIconID = 808;
  38.  
  39. const short        kDocWindowTemplateID = 1026;
  40.  
  41. class    TDocWindow    :    public TWindow
  42. {
  43. public:
  44.                             TDocWindow();
  45.     virtual                 ~TDocWindow();
  46.  
  47.     virtual WindowPtr        MakeNewWindow(WindowPtr pBehindWindow);
  48.  
  49.     virtual    void            AdjustCursor(EventRecord* pEvent);
  50.  
  51.     virtual void            Activate(Boolean theIsActivating);
  52.     virtual void            Draw(void);
  53.     virtual void            Click(EventRecord* pEvent);
  54.     virtual void            SetupMenus(void);
  55.     virtual void            AdjustForNewWindowSize(Rect* pOldRect,Rect* pNewRect);
  56.  
  57.     virtual    Boolean            Close(void);
  58.     
  59.     virtual  void  SetDocFile(FSSpec* pFSSpec);
  60.     virtual  void  HandleMenuCommand(short theMenuID, short theMenuItem);
  61.  
  62.     virtual    OSErr            DragEnterWindow(DragReference theDrag);
  63.     virtual    OSErr            DragInWindow(DragReference theDrag);
  64.     virtual    OSErr            DragLeaveWindow(DragReference theDrag);
  65.     virtual    OSErr            HandleDrop(DragReference theDrag);
  66.     
  67. protected:
  68.     THPrint            fTHPrint;
  69.     Boolean            fDirty;
  70.     static    unsigned long    fgUntitledTagCount;
  71.     ThreadID                fSpinnerThreadID;
  72.     short                    fCurrentSpinningArrowIconID;
  73.  
  74. public:
  75.     virtual void            SpinHeaderArrows();
  76. protected :
  77.     virtual  void         PageSetupDlg(Boolean theCustomFlag);
  78.     virtual  void         PrintDlg(Boolean theDialogFlag);
  79.     virtual  Boolean  SaveDocument(void);
  80.     virtual  Boolean  SaveDocumentAs(void);
  81.     virtual  Boolean        IsDirty(void);
  82.     virtual  void        SetDirty(Boolean  theDirtyFlag);
  83.         TDocFile*        fDocFile;
  84. };
  85.  
  86. #endif
  87.